#include "util/cmdline.hpp"
#include <iostream>

using namespace std;
using namespace ibox::util;

void usage() {
  cout << "./test_cmdline --ip 0.0.0.0 --port 8080 --verbose" << endl;
  cout << "options:" << endl;
  cout << "    -h,--help      print usage" << endl;
  cout << "    --ip           listen ip" << endl;
  cout << "    --port         listen port" << endl;
  cout << "    --verbose      verbose message" << endl;
  cout << endl;
}

int main(int argc, char *argv[]) {
    string ip{};
    int port{};
    bool verbose{};
    CmdLine::StrOptRequired(&ip, "ip");
    CmdLine::IntOptRequired(&port, "port");
    CmdLine::BoolOpt(&verbose, "verbose");
    CmdLine::SetUsage(usage);
    CmdLine::Parse(argc, argv);

    cout << "ip: " << ip << endl;
    cout << "port: " << port << endl;
    cout << "verbose: " << verbose << endl;
}
